﻿using System;

public class CounterElementOfArray
{
    public static decimal[] array;

    public static void Main()
    {
        decimal number;
        int counter;

        array = Common.InputArray(array, "");
        number = Common.InputDecimal(Common.InputArrayDescription(array, "") + "Number = ");
        counter = Counter(number, array);
        Console.WriteLine("\nThe number {0} is on {1} position{2} in the array!\n", 
            number, counter, ((1 < counter) || (counter == 0)) ? "s" : "");
    }

    public static int Counter(decimal number, decimal[] array)
    {
        int counter = 0;

        foreach (int member in array)
            if (member == number)
                counter++;

        return counter;
    }
}